from flask import Flask, request
import sys
 
app = Flask(__name__)
 
@app.route('/')
def hello():
    return 'Hello, Flask!'

@app.route('/getrp', methods=['POST'])
def getrp():
    print(request.headers)
    print(request.form)
    if request.cookies.get('id')=='123' and request.form['age']=='19':
        return 'Hello, I get right parameters!'
    else:
        return "wrong parameters"
 
if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True, port=int(sys.argv[1]))
